/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package group2assignone.ucm.manager;

import group2assignone.dao.MyDAO;
import group2assignone.model.Person;
import group2assignone.ucm.UCController;
import group2assignone.ucm.UCStartup;
import group2assignone.view.ClientListView;
import group2assignone.view.UITool;
import group2assignone.view.manager.UserDetailsView;

/**
 *
 * @author Flick
 */
public class UCShowUserDetails implements UCController {

    ClientListView view;

    public UCShowUserDetails(ClientListView view) {
        this.view = view;
    }

    public void run() {
        //if (!view.isNoSelection()) {  //if have selection
            //get view details;
            String uName = view.getUserName();
            view.dispose();
            MyDAO d = UCStartup.getInstance().getDAO();
            Person p = d.sQLFindPerson(uName);

            UserDetailsView view2 = new UserDetailsView(p);
            view2.go();

//        } else {
//            UITool.displayError("Select a User to view!!!", view);
//        }
    }
}
